﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Nha_Hang_Khach_San.Classes
{
    public class Animation
    {
        public static Storyboard SlideImageEffect(UIElement controlToAnimate, double positionToMove)
        {
            DoubleAnimation da = new DoubleAnimation();
            da.Duration = new Duration(TimeSpan.FromSeconds(1));

            Storyboard sb = new Storyboard();
            sb.Duration = new Duration(TimeSpan.FromSeconds(1));
            sb.Children.Add(da);

            Storyboard.SetTarget(da, controlToAnimate);
            Storyboard.SetTargetProperty(da, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.X)"));
            da.To = positionToMove;
            return sb;
        }
    }
}
